home *** CD-ROM | disk | FTP | other *** search
/ Sun Solutions 1997 April to September / Sun Solutions CD - APR '97 - SEP '97 (704-3778-12 Rev. H)(Sun Microsystems, Inc.)(1997).iso / products / bin / update.bk.pl < prev    next >
Perl Script  |  1997-01-21  |  41KB  |  1,191 lines

  1. #!/net/cdware/export/home/cdware/lab/bin/perl 
  2. # ------------------------------------------------------------
  3.  
  4. # update.pl, by Jean-Pierre Girard (jpg@corrado.sun.com)
  5. # This allows the user to edit or create the _info file
  6. # necessary for the SunSolutions.
  7. # version 1.0, Feb, 20 1996
  8. # ------------------------------------------------------------
  9.  
  10. # Bugs and other fixes
  11.  
  12. # ------------------------------------------------------------
  13. %Special = (
  14. "internet", "596,200"
  15. ,"Sun", "596,167"
  16. );
  17. #
  18. # Below are fields delimited by ^.
  19. # field 1: Full category name
  20. # field 2: Category image name
  21. # field 3: Category header height (if other than default)
  22. # field 4:
  23. # field 5:
  24. #
  25. %MainCat = (
  26. "access", "Internet Access^intacc.gif^"
  27. , "service", "Services for the Internet^intserv.gif^"
  28. , "commerce", "Internet Commerce^intcomm.gif^"
  29. , "publishing", "Internet Publishing^intpub.gif^"
  30. , "intsecurity", "Internet Security^intsec.gif^"
  31. #Added Specifically for March 97 Issue
  32. , "intauth", "Internet Authoring/Java^intauth.gif^"
  33. , "intcontmgt", "Internet Content Management^intcontmgt.gif^"
  34. , "intdbconn", "Internet Database Connectivity^intdbconn.gif^"
  35. , "intemail", "Internet Email^intemail.gif^"
  36. , "intgrpware", "Internet Groupware/Document Flow^intgrpware.gif^"
  37. , "intoffprod", "Internet Office Productivity^intoffprod.gif^"
  38. , "intprodauth", "Internet Production/Authoring^intprodauth.gif^"
  39. , "intsrcheng", "Internet Search Engines^intsrcheng.gif^"
  40. , "intstemgt", "Internet Site Management^intstemgt.gif^"
  41. , "intswdev", "Internet Software Development Tools^intswdev.gif^"
  42. , "intwebad", "Internet Web Advertising^intwebad.gif^"
  43. , "intwebcms", "Internet Web CMS^intwebcms.gif^"
  44. , "intwebdw", "Internet Web Datawarehouse^intwebdw.gif^"
  45. , "intwebmon", "Internet Web Monitoring^intwebmon.gif^"
  46. , "intwebserv", "Internet Web Server^intwebserv.gif^"
  47. , "intwebste", "Internet Web Site^intwebste.gif^"
  48. , "intwebvideo", "Internet Web Video^intwebvideo.gif^"
  49. , "intwebvoice", "Internet Web Voice^intwebvoice.gif^"
  50. #Main Categories from March 97 front GUI
  51. , "Hardware", "^hard.gif^"
  52. , "Services", "^serv.gif^"
  53. , "companies", "^comps.gif^"
  54. , "Sun", "Search Sun Products <form method=get ACTION=http://localhost:7999/cgi-bin/brandnewwais.pl/wais_SunSolutions></font><input type=text name=isindex size=15>^sprods.gif^"
  55. #These are Software subs
  56. ,"archive", "Archiving, Storage Management & Backup Solutions^sstormn.gif^"
  57. ,"business", "Business Solutions^sbizsol.gif^"
  58. , "cad_cae", "Computer Aided Design/Engineering^scade.gif^"
  59. , "catalogs", "Catalogs^scata.gif^"
  60. , "client_server", "Client/Server Solutions^sclnt.gif^"
  61. , "desktop_apps", "Desktop Applications^sdesk.gif^220"
  62. , "diag_flow", "Diagramming and Flowcharting^sdiaflo.gif^"
  63. , "doc_mgt", "Document Management^sdocmn.gif^"
  64. , "epubs", "Electronic Publishing^selecpb.gif^"
  65. , "graphics_imaging", "Graphics and Imaging^sgfximg.gif^"
  66. , "info_mgt", "Information Management^sinfomn.gif^"
  67. , "multimedia", "Multimedia^smulti.gif^"
  68. , "networking", "Networking^snetwk.gif^"
  69. , "security", "Security^ssecu.gif^"
  70. , "sw_eng", "Software Engineering^ssfteng.gif^"
  71. , "sys_admin", "System Administration^ssysad.gif^"
  72. , "telco", "Telecommunications^stelco.gif^"
  73. , "training", "Training^strain.gif^"
  74. #Added for March 97 Issue
  75. , "financial", "Financial Services^financial.gif^220"
  76. , "utilities", "Utilities^utilities.gif^220"
  77. );
  78.  
  79. %Categories = (
  80. "access", "Internet Access"
  81. , "service", "Services for the Internet"
  82. , "commerce", "Internet Commerce"
  83. , "publishing", "Internet Publishing"
  84. , "intsecurity", "Internet Security"
  85. #Added Specifically for March 97 Issue
  86. , "intauth", "Internet Authoring/Java"
  87. , "intcontmgt", "Internet Content Management"
  88. , "intdbconn", "Internet Database Connectivity"
  89. , "intemail", "Internet Email"
  90. , "intgrpware", "Internet Groupware/Document Flow"
  91. , "intoffprod", "Internet Office Productivity"
  92. , "intprodauth", "Internet Production/Authoring"
  93. , "intsrcheng", "Internet Search Engines"
  94. , "intstemgt", "Internet Site Management"
  95. , "intswdev", "Internet Software Development Tools"
  96. , "intwebad", "Internet Web Advertising"
  97. , "intwebcms", "Internet Web CMS"
  98. , "intwebdw", "Internet Web Datawarehouse"
  99. , "intwebmon", "Internet Web Monitoring"
  100. , "intwebserv", "Internet Web Server"
  101. , "intwebste", "Internet Web Site"
  102. , "intwebvideo", "Internet Web Video"
  103. , "intwebvoice", "Internet Web Voice"
  104. #Main Categories from March 97 front GUI
  105. , "Hardware", ""
  106. , "Services", ""
  107. , "companies", ""
  108. , "Sun", "Search Sun Products <form method=get ACTION=http://localhost:7999/cgi-bin/brandnewwais.pl/wais_SunSolutions></font><input type=text name=isindex size=15>"
  109. #These are Software subs
  110. ,"archive", "Archiving, Storage Management & Backup Solutions"
  111. ,"business", "Business Solutions"
  112. , "cad_cae", "Computer Aided Design/Engineering"
  113. , "catalogs", "Catalogs"
  114. , "client_server", "Client/Server Solutions"
  115. , "desktop_apps", "Desktop Applications"
  116. , "diag_flow", "Diagramming and Flowcharting"
  117. , "doc_mgt", "Document Management"
  118. , "epubs", "Electronic Publishing"
  119. , "graphics_imaging", "Graphics and Imaging"
  120. , "info_mgt", "Information Management"
  121. , "multimedia", "Multimedia"
  122. , "networking", "Networking"
  123. , "security", "Security"
  124. , "sw_eng", "Software Engineering"
  125. , "sys_admin", "System Administration"
  126. , "telco", "Telecommunications"
  127. , "training", "Training"
  128. #Added for March 97 Issue
  129. , "financial", "Financial Services"
  130. , "utilities", "Utilities"
  131. );
  132. ##############################################################################
  133. # getField 
  134. ##############################################################################
  135.  
  136. sub getField
  137. {
  138. local($string1, $string2) = @_;
  139. $count=0;
  140. $string1 =~ s/\^/\n/g;
  141. @elements = split(/\n/, $string1);
  142.   foreach $item (@elements) {
  143.   $count++;
  144.     if ($count eq $string2) {
  145.     $return=$item;
  146.     }
  147.     if ($string2 < 1 | $string2 > $count ) {
  148.         $return = "Invalid Field number";
  149.     }
  150.   }  
  151.   $return;
  152. }
  153.  
  154. ##############################################################################
  155. # PrintHtml:
  156. ##############################################################################
  157. sub PrintHtml
  158. {
  159.     local($StrHtml1, $Str, $StrHtml2) = @_;
  160.     
  161.     if ($HTML_FORMAT eq "true") {
  162.         print STDOUT $StrHtml1;
  163.     }
  164.  
  165.     print STDOUT $Str;
  166.  
  167.     if ($HTML_FORMAT eq "true") {
  168.         print STDOUT $StrHtml2;
  169.     }
  170. }
  171. ##############################################################################
  172. # CheckLinks:
  173. ##############################################################################
  174. sub CheckLinks
  175. {
  176.     &PrintHtml("<BR>", "\nChecking links1...\n", "<BR>");
  177.     $ListDir = `cd $PRODUCTS_DIR; ls`;
  178.     $ListDir =~ s/gui|SunSolutions|DEV|hotjava|tempjas|temp//g;
  179.     #$ListDir =~ s/\n+/ /g;
  180.     @dirfields = split(/\s+/, $ListDir);
  181.     foreach $Dir (@dirfields) {
  182.         if ($Dir =~ /SunSolutions|DEV/) {
  183.             next;
  184.         }
  185.         &PrintHtml("<DD><DD>",  "\t\tTesting $Dir ...\n", "<BR>");
  186.         $ListFiles = `find "$PRODUCTS_DIR/$Dir" -name "*.html" -print`;
  187.         $ListFiles .= `find "$PRODUCTS_DIR/$Dir" -name "*.htm" -print`;
  188.         #$ListDir =~ s/gui|SunSolutions|DEV|hotjava|tempjas|temp//g;
  189.         @filefields = split(/\s+/, $ListFiles);
  190.         foreach $File (@filefields) {
  191.             if ($File =~ /SunSolutions.(frame|head).html/) {
  192.                 next;
  193.             }
  194.             #&PrintHtml("<DD><DD>",  "\t\tTesting $File ...\n", "<BR>");
  195.             if (open (HTMLFILE, $File)) {
  196.                 while(<HTMLFILE>) {
  197.                     chop;
  198.                     $Line = $_;
  199.                     $LinePrint = $Line;
  200.                     if ($HTML_FORMAT eq "true") {
  201.                         $LinePrint =~ s/</</g;
  202.                         $LinePrint =~ s/>/>/g;
  203.                     }
  204.                     if ($Line =~ /HREF/i) {
  205.                         $Ref = $Line;
  206.                         $Ref =~ s/.*HREF *= *"?([^" >#]*)[" >#].*/\1/i;
  207.                         if ($Ref =~ /HrefButtonArea/) {
  208.                             $Ref =~ s/.*HrefButtonArea,\d+,\d+,\d+,\d+,([^" >]*)/\1/;
  209.                         }
  210.                         #print "\t$Line\n\t->$Ref\n";
  211.                         if ($Ref eq $Line) {
  212.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. File=$File\n", "</B><BR>");
  213.                             &PrintHtml("<DD>",  "\t$LinePrint\n\t->$Ref\n", "<BR>");
  214.                         }
  215.                         if ($Ref eq "" && $Line !~ /HREF *= *"?\#/i) {
  216.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. File=$File\n", "</B><BR>");
  217.                             &PrintHtml("<DD>",  "\t$LinePrint\n\t->$Ref\n", "<BR>");
  218.                         }
  219.                         if ($Ref !~ /mailto:|ftp:|http:\/\/|req_more_info.pl/i || $Ref =~ /http:\/\/localhost/) {
  220.                         #if ($Ref !~ /mailto:|ftp:|http:\/\/[^l]|req_more_info.pl/i) {
  221.                             #print "->$Ref\n";
  222.                             $ShortDir = $File;
  223.                             $ShortDir =~ s?(.*\/)[^/]*$?\1?;
  224.                             if ($Ref =~ /http:\/\/localhost/i) {
  225.                                 $Ref =~ s?http://localhost:7999/(.*)$?$PRODUCTS_DIR/\1?;
  226.                                 #print "\t\tin http:$ShortDir/$Ref from $File\n";
  227.                                 if ($Ref !~ /cgi-bin/ && ! -s "$ShortDir/$Ref") {
  228.                                     &PrintHtml("<B>", "ERROR: Missing link $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  229.                                 }
  230.                             } elsif ($Ref =~ /file:/i) {
  231.                                 $Ref =~ s?http://localhost:7999/(.*)$?$PRODUCTS_DIR/\1?;
  232.                                 #print "\t\tin file: $Ref from $File\n";
  233.                                 unless (-s "$Ref") {
  234.                                     &PrintHtml("<B>", "ERROR: Missing link $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  235.                                 }
  236.                             } else {
  237.                                 #print "\t\tin else: $ShortDir/$Ref from $File\n";
  238.                                 if ($Ref !~ /^#/) {
  239.                                     unless ($Ref !~ /^#/ && -s "$ShortDir/$Ref") {
  240.                                         &PrintHtml("<B>", "ERROR: Missing link $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  241.                                     }
  242.                                 }
  243.                             }
  244.                         }
  245.                         
  246.                     }
  247.                     if ($Line =~ /<IMG/i) {
  248.                         $Ref = $Line;
  249.                         $Ref =~ s/.*IMG.*SRC *= *"?([^" >]*)[" >].*/\1/i;
  250.                         #print "\t$Line\n\t->$Ref\n";
  251.                         if ($Ref eq $Line) {
  252.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. File=$File\n", "</B><BR>");
  253.                             &PrintHtml("<DD>",  "\t$LinePrint\n\t->$Ref\n", "<BR>");
  254.                         }
  255.                         if ($Ref eq "") {
  256.                             &PrintHtml("<B>",  "ERROR: Bug? in update.pl. File=$File\n", "</B><BR>");
  257.                             &PrintHtml("<DD>",  "\t$LinePrint\n\t->$Ref\n", "<BR>");
  258.                         }
  259.                         #print "->$Ref\n";
  260.                         $ShortDir = $File;
  261.                         $ShortDir =~ s?(.*\/)[^/]*$?\1?;
  262.                         if ($Ref =~ /http:\/\/localhost/i) {
  263.                             $Ref =~ s?http://localhost:7999/(.*)$?$PRODUCTS_DIR/\1?;
  264.                             #print "\t\tin http:$ShortDir/$Ref from $File\n";
  265.                             if ($Ref !~ /cgi-bin/ && ! -s "$ShortDir/$Ref") {
  266.                                 &PrintHtml("<B>", "ERROR: Missing image $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  267.                             }
  268.                         } elsif ($Ref =~ /file:/i) {
  269.                             $Ref =~ s?http://localhost:7999/(.*)$?$PRODUCTS_DIR/\1?;
  270.                             #print "\t\tin file: $Ref from $File\n";
  271.                             unless (-s "$Ref") {
  272.                                 &PrintHtml("<B>", "ERROR: Missing image $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  273.                             }
  274.                         } else {
  275.                             #print "\t\tin else: $ShortDir/$Ref from $File\n";
  276.                             if ($Ref !~ /^#/) {
  277.                                 unless ($Ref !~ /^#/ && -s "$ShortDir/$Ref") {
  278.                                     &PrintHtml("<B>", "ERROR: Missing image $Ref from $File. Line = $LinePrint\n", "</B><BR>");
  279.                                 }
  280.                             }
  281.                         }
  282.                         
  283.                     }
  284.                     #$Line =~ tr/
  285.                 }
  286.                 close(HTMLFILE);
  287.             } else {
  288.                 &PrintHtml("<B>",  "ERROR: $File cannot be open\n", "</B><BR>");
  289.             }
  290.         }
  291.     }
  292. }
  293. ##############################################################################
  294. # CheckFiles:
  295. ##############################################################################
  296. sub CheckFiles
  297. {
  298.     $ListDir = `cd $PRODUCTS_DIR; ls`;
  299.     $ListDir =~ s/gui|SunSolutions|DEV|hotjava|tempjas|temp//g;
  300.     #$ListDir =~ s/\n+/ /g;
  301.     @filefields = split(/\s+/, $ListDir);
  302.     foreach $Dir (@filefields) {
  303.         unless (-s "$PRODUCTS_DIR/$Dir/_info") {
  304.             &PrintHtml("", "WARNING: _info file missing in $Dir\n", "<BR>");
  305.         }
  306.     }
  307.     #print $ListDir;
  308. }
  309.  
  310. ##############################################################################
  311. # InitCompInfo:
  312. ##############################################################################
  313. sub InitCompInfo
  314. {
  315.     #$ListDir = `ls $PRODUCTS_DIR/[CD]*/_info`;
  316.     $ListDir = `ls $PRODUCTS_DIR/*/_info`;
  317.     #print "ls $PRODUCTS_DIR/*/_info";
  318.  
  319.     @filefields = split(/\s+/, $ListDir);
  320.     #print $filefields;
  321.     foreach $INFOFILENAME (@filefields) {
  322.         $ShortDir = $INFOFILENAME;
  323.         $ShortDir =~ s?.*/([^/]*)/_info$?\1?;
  324.         if (-l "$PRODUCTS_DIR/$ShortDir") {
  325.             next;
  326.         }
  327.         if (-s $INFOFILENAME && open (INFOFILE, $INFOFILENAME)) {
  328.             if ($REPORT ne "true") {
  329.                 #&PrintHtml("<DD><DD>", "\t\tReading $INFOFILENAME\n", "<BR>");
  330.             }
  331.     
  332.                     while (<INFOFILE>) {
  333.                         $Line = $_;
  334.                 unless ($Line =~ /^[     ]*$/ || $Line =~ /^#/) {
  335.                     last;
  336.                 }
  337.             }
  338.                     ($Companies{$ShortDir}, $Description{$ShortDir}, $Platform{$ShortDir}, $ChosenCat{$ShortDir}, $WebSite{$ShortDir}, $Email{$ShortDir}, $HomePageName{$ShortDir}) = split(/\^/, $Line);
  339.  
  340.             if ($CHECK eq "true") {
  341.                 $_ = $Line;
  342.                 #print "Line=$Line\n";
  343.                 $count = tr/^//;
  344.                 #print "$_: $count\n";
  345.                 if ($count != 7) {
  346.                     &PrintHtml("<B>", "ERROR: Not the correct number of parameters in the first line of $INFOFILENAME\n", "<BR>");
  347.                 }
  348.                 if ($Platform{$ShortDir} =~ /demo|testdrive|install/ && ! -d "$PRODUCTS_DIR/$ShortDir/_install") {
  349.                     &PrintHtml("<B>", "ERROR: Missing _install directory in $ShortDir\n", "<BR>");
  350.                 }
  351.                 if ($HomePageName{$ShortDir} eq "") {
  352.                     &PrintHtml("<B>", "ERROR: Missing Home page name in $ShortDir\n", "<BR>");
  353.                 } else {
  354.                     unless (-s "$PRODUCTS_DIR/$ShortDir/$HomePageName{$ShortDir}") {
  355.                         &PrintHtml("<B>", "ERROR: $HomePageName{$ShortDir} file missing in $ShortDir\n", "<BR>");
  356.                     }
  357.                 }
  358.             }
  359.             $ProdNum = 1;
  360.                     while (<INFOFILE>) {
  361.                 if ($_ =~ /^[     ]*$/ || $_ =~ /^#/) {
  362.                     next;
  363.                 }
  364.                 if ($CHECK eq "true") {
  365.                     unless ($_ =~ /^.*[^     ].*\^$/) {
  366.                         chop($_);
  367.                         &PrintHtml("<B>", "ERROR: Wrong line in $INFOFILENAME: \"$_\"\n", "<BR>");
  368.                     }
  369.                 }
  370.                             $Product=$_;
  371.                             chop($Product);
  372.                             chop($Product);
  373.                             $Products{$ShortDir . $ProdNum} = $Product;
  374.                 #print "jp = $Product\n";
  375.                 $ProdNum++;
  376.                     }
  377.             close(INFOFILE);
  378.             } else {
  379.                     &PrintHtml("", "Can't open $INFOFILENAME\n", "<BR>");
  380.         }
  381.     }
  382.     #foreach $ShortDir (sort keys(%Companies)) {
  383.         #print "$Companies{$ShortDir}, $Description{$ShortDir}, $Platform{$ShortDir}, $ChosenCat{$ShortDir}, $WebSite{$ShortDir}, $Email{$ShortDir}, $HomePageName{$ShortDir}\n";
  384.     #}
  385.     #%RevComp = reverse %Companies;
  386.     #if (@RevComp != @Companies) {
  387.         #print "WARNING: two directory with the same company name->possible problem!\n";
  388.     #}
  389.     %RevProd = reverse %Products;
  390.     if (@RevProd != @Products) {
  391.         &PrintHtml("", "WARNING: two products with the same name->possible problem!\n", "<BR>");
  392.     }
  393.     #print @Products;
  394.     foreach $ShortDir (sort keys(%Products)) {
  395.         print "$ShortDir, $Products{$ShortDir}\n";
  396.     }
  397.     #foreach $ShortDir (sort keys(%RevProd)) {
  398.         #print "$ShortDir, $RevProd{$ShortDir}\n";
  399.     #}
  400.     #foreach $ShortDir (sort keys(%RevComp)) {
  401.         #print "$RevComp{ShortDir}\n";
  402.     #}
  403.     #print %RevComp;
  404. }
  405.  
  406. sub FilteredSortCat
  407. {
  408.     ($al = $Categories{$a}) =~ tr/A-Z/a-z/;
  409.     $al =~ s/^the //;
  410.     $al =~ s/^\.//;
  411.     $al =~ s/^[     ]*//;
  412.  
  413.     ($bl = $Categories{$b}) =~ tr/A-Z/a-z/;
  414.     $bl =~ s/^the //;
  415.     $bl =~ s/^\.//;
  416.     $bl =~ s/^[     ]*//;
  417.  
  418.     $al cmp $bl;
  419. }
  420. sub FilteredSort
  421. {
  422.     ($al = $a) =~ tr/A-Z/a-z/;
  423.     $al =~ s/^the //;
  424.     $al =~ s/^\.//;
  425.     $al =~ s/^[     ]*//;
  426.  
  427.     ($bl = $b) =~ tr/A-Z/a-z/;
  428.     $bl =~ s/^the //;
  429.     $bl =~ s/^\.//;
  430.     $bl =~ s/^[     ]*//;
  431.  
  432.     $al cmp $bl;
  433. }
  434. sub FilteredSortComp
  435. {
  436.     $al = $Companies{$a};
  437.     $al =~ tr/A-Z/a-z/;
  438.     $al =~ s/^the //;
  439.     $al =~ s/^\.//;
  440.     $al =~ s/^[     ]*//;
  441.  
  442.     $bl = $Companies{$b};
  443.     $bl =~ tr/A-Z/a-z/;
  444.     $bl =~ s/^the //;
  445.     $bl =~ s/^\.//;
  446.     $bl =~ s/^[     ]*//;
  447.  
  448.     #print STDOUT "$al =? $bl\n";
  449.     $al cmp $bl;
  450. }
  451.  
  452. ##############################################################################
  453. # CreateSoft
  454. ##############################################################################
  455. sub CreateSoft
  456. {
  457.     &PrintHtml("<BR>", "\nCreating Software page...\n", "<BR>");
  458.     $SOFTFILENAME = "$CAT_DIR/Software.html";
  459.     $SOFTHEADFILENAME = "$CAT_DIR/Software.head.html";
  460.     if (open (SOFTFILE, "> $SOFTFILENAME") && open(SOFTHEADFILE, "> $SOFTHEADFILENAME")) {
  461.         $old = select(SOFTHEADFILE);
  462.         $~ = "SOFTWAREHEAD"; 
  463.         write SOFTHEADFILE;   
  464.         close (SOFTHEADFILE); 
  465.  
  466.         select(SOFTFILE);
  467.         $~ = "CATBEGIN";
  468.         write SOFTFILE;
  469.  
  470.         $Letter = "0";
  471.         foreach $Cat (sort FilteredSortCat keys(%Categories)) {
  472.             unless ($Categories{$Cat} eq "") {
  473.                 $CatAb = $Categories{$Cat};
  474.                 $CatAb =~ tr/a-z/A-Z/;
  475.                 $CatAb =~ s/^THE //;
  476.                 $CatAb =~ s/^\.//;
  477.                 #print STDOUT "$CatAb, $Letter\n";
  478.                 unless ($CatAb =~ /^$Letter/) {
  479.                     $Letter = substr($CatAb, 0, 1);
  480.                     print SOFTFILE "<DT><A NAME=\"$Letter\"><B>$Letter</B></A>";
  481.                     #push (@Letters, $Letter);
  482.  
  483.                 }
  484.                   #height of each category head, default 150            
  485.                     if (&getField($MainCat{$Cat}, "3") == "") {
  486.                      $height = "150";
  487.                 } else {
  488.                      $height = &getField($MainCat{$catword}, "3");
  489.                 }    
  490.                 print SOFTFILE "<DD><a href=\"http://localhost:7999/cgi-bin/show.bat/?DEST=$Cat&SIZE=$height\"><B>$Categories{$Cat}</B></a><br>\n";
  491.             }
  492.         }
  493.         $~ = "CATEND";
  494.         write SOFTFILE;
  495.  
  496.         close (SOFTFILE);
  497.         select($old);
  498.     }
  499.     &PrintHtml("<DD>", "\tSoftware.html page created.\n", "<BR>");
  500. }
  501.  
  502. ##############################################################################
  503. # CreateCat: 
  504. ##############################################################################
  505. sub CreateCat
  506. {
  507.  
  508.     foreach $catword  ( sort keys(%Categories)) {
  509.         #chop $catword;
  510.         &PrintHtml("<BR>", "\nCreating $catword category page ...\n", "<BR>");
  511.              $CATFILENAME = "$CAT_DIR/$catword.html";
  512.              $CATHEADFILENAME = "$CAT_DIR/$catword.head.html";
  513.         #print STDOUT "Bef open, $CATFILENAME, $CATHEADFILENAME\n";
  514.         if (open (CATFILE, "> $CATFILENAME") && open(CATHEADFILE, "> $CATHEADFILENAME")) {
  515.             $old = select(CATFILE);
  516.  
  517.             $~ = "CATBEGIN";
  518.             write CATFILE;
  519.             $Letter = "0";
  520.             @Letters = ();
  521.             foreach $ShortName (sort FilteredSortComp keys(%Companies)) {
  522.                 $Comp = $Companies{$ShortName};
  523.                 #print STDOUT "$ShortName, $Comp\n";
  524.                 
  525.                 unless ($ChosenCat{$ShortName} =~ /$catword/ 
  526.                     || $catword eq "companies") {
  527.                     next;
  528.                 }
  529.                 $CompAb = $Comp;
  530.                 $CompAb =~ tr/a-z/A-Z/;
  531.                 $CompAb =~ s/^THE //;
  532.                 $CompAb =~ s/^\.//;
  533.                 unless ($CompAb =~ /^$Letter/) {
  534.                     $Letter = substr($CompAb, 0, 1);
  535.                     print CATFILE "<DT><A NAME=\"$Letter\"><B>$Letter</B></A>";
  536.                     push (@Letters, $Letter);
  537.                 }
  538.  
  539.                     #print CATFILE "     <DD><a HREF=http://localhost:7999/$ShortName/$HomePageName{$ShortName}><B>$Comp</B></a> $Description{$ShortName}\n";
  540.                     print CATFILE "     <DD><a HREF=http://localhost:7999/$ShortName/$FRAMEBASICNAME><B>$Comp</B></a> $Description{$ShortName}\n";
  541.                                 print "<dd><b><i>", $Products{$ShortName . "1"}, "</i></b>\n" ;                             
  542.                                 if ($Products{$ShortName . "2"} ne "") {
  543.                                         print ", <b><i>", $Products{$ShortName . "2"}, "</i></b>\n" ;
  544.                                 }
  545.                                 if ($Products{$ShortName . "3"} ne "") {
  546.                                         print ", <b><i>", $Products{$ShortName . "3"}, "</i></b>\n" ;
  547.                                 }
  548.                                 if ($Products{$ShortName . "4"} ne "") {
  549.                                         print ", <b><i>", $Products{$ShortName . "4"}, "</i></b>\n" ;
  550.                                 }
  551.                                 if ($Products{$ShortName . "5"} ne "") {
  552.                                         print ", <b><i>", $Products{$ShortName . "5"}, "</i></b>\n" ;
  553.                                 }
  554. #
  555. #        This is for testdrive, install, and demo images
  556. #
  557.                 if ($Platform{$ShortName} =~ /demo/ ) {
  558.                 print CATFILE "<img src=\"http://localhost:7999/SunSolutions/images/demo.gif\">";
  559.                 }
  560.                                 if ($Platform{$ShortName} =~ /testdrive/ ) { 
  561.                                 print CATFILE "<img src=\"http://localhost:7999/SunSolutions/images/testdrive.gif\">";
  562.                                 } 
  563.                                 if ($Platform{$ShortName} =~ /install/ ) { 
  564.                 print CATFILE "<img src=\"http://localhost:7999/SunSolutions/images/install.gif\">";
  565.                                 } 
  566.                 print CATFILE "\n";
  567.  
  568.                 }
  569.          
  570.         
  571.             $~ = "CATEND";
  572.             write CATFILE;
  573.             close (CATFILE);
  574.         
  575.             if ($Special{$catword} eq "") {
  576.                 $AppWidth="596"; 
  577.                  $AppHeight="75";
  578.             } else {
  579.                 @tmp=split(/,/,$Special{$catword});
  580.                                 $AppWidth=@tmp[0]; 
  581.                 $AppHeight=@tmp[1];
  582.             } 
  583.                 
  584.                         #&PrintHtml("<DD>", "\ttest $AppWidth $AppHeight $Special{$catword} $catword\n", "<BR>");
  585.  
  586.             select(CATHEADFILE);
  587.             $~ = "CATHEADERBEGIN";
  588.             write CATHEADFILE;
  589.                 $GI = &getField($MainCat{$catword}, "2");
  590.         print CATHEADFILE "<IMG border=0 SRC=\"$DIR_IMAGES/$GI\"  alt=\"\" USEMAP=#banner ismap>";
  591.         #if ($catword ne "companies") {
  592.         #    print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=companies\" COORDS=27,4,96,44>\n";
  593.         #} else {
  594.         print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=companies\" COORDS=7,12,69,40>\n";
  595.         #}
  596.         print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=products\" COORDS=3,48,69,80>\n";
  597.         #if ($catword ne "Hardware") {
  598.         #print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=Hardware\" COORDS=96,0,165,40>\n";
  599.         #} else {
  600.         print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http:\/\/localhost:7999\/SunSolutions\/docs\/info\/Info.html\" COORDS=73,6,142,46>\n";
  601.         #}
  602.         #if ($catword ne "Services" && $catword ne "companies" && $catword ne "internet") {
  603.             #        print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=Services\" COORDS=96,38,165,78>\n";
  604.         #} else {
  605.             print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http:\/\/localhost:7999\/SunSolutions\/index.html\" COORDS=72,40,143,85>\n";
  606.         #}
  607.                 #if ($catword eq "Sun") {
  608.         #    print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=Sun_Software&SIZE=35\" COORDS=198,85,366,170>\n";
  609.         #    print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=Sun_Hardware&SIZE=35\" COORDS=401,85,575,170>\n";
  610.         #}
  611.         #if ($catword eq "internet") {
  612.         #print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"../.Internet/cover.htm\" COORDS=180,0,596,166>\n";
  613.         #} else {
  614.         #print CATHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http://localhost:7999/SunSolutions/index.html\" COORDS=198,0,596,62>\n";
  615. #}
  616.         $~ = "CATHEADERMIDDLE";
  617.         write CATHEADFILE;
  618.  
  619.                 #print CATHEADFILE `cat $Header{$catword}`;
  620.             unless ($Categories{$catword} eq "") {
  621.  
  622. #Commented out on 1/20/97 Jason for March 97
  623.  
  624.                     #print CATHEADFILE "<CENTER><FONT SIZE=24>$Categories{$catword}</FONT></CENTER>";
  625.             }
  626. #Comment STOP Here Jason
  627.     
  628.             #@Letters = ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
  629.             if (@Letters > 7) {
  630.                 print CATHEADFILE "<B>Go to:  ";
  631.                 foreach $letter (@Letters) {
  632.                     print CATHEADFILE "<A HREF=\"?DEST=$catword&L=$letter" . ($Categories{$catword} eq ""? "" : "&SIZE=180") . "\">$letter</A>\n";
  633.                 }
  634.             }
  635. #Added by Jason 1/20/97 for March 97 Category Owners
  636.             if ($catword eq "financial") {
  637.             print CATHEADFILE "<center><img src=/SCO/ad/ad.gif></center>";
  638.             }
  639.             $~ = "CATHEADEREND";
  640.             write CATHEADFILE;
  641.             close (CATHEADFILE);
  642.      
  643.             &PrintHtml("<DD>", "\t$catword category page created.\n", "<BR>");
  644.  
  645.             select($old);
  646.         } else {
  647.             die "\nERROR: Cannot write $CATFILENAME or $CATHEADFILENAME!\nTry to be superuser!\n\n";
  648.         }
  649.     }
  650. }
  651.  
  652. ##############################################################################
  653. # CreateReport:
  654. ##############################################################################
  655. sub CreateReport
  656. {
  657.     $TotalSize = 0;
  658.     foreach $ShortName (sort FilteredSortComp keys(%Companies)) {
  659.         #$ShortName = $RevComp{$Comp};    
  660.         $Comp = $Companies{$ShortName};
  661.         &PrintHtml("<B>", "$Comp:\n", "</B><BR>");
  662.         &PrintHtml("<DD>", "\tProduct1: " . $Products{$ShortName . "1"} . "\n", "<BR>");
  663.         if ($Products{$ShortName . "2"} ne "") {
  664.             &PrintHtml("<DD>", "\tProduct2: " . $Products{$ShortName . "2"} . "\n", "<BR>");
  665.         }
  666.         if ($Products{$ShortName . "3"} ne "") {
  667.             &PrintHtml("<DD>", "\tProduct3: " . $Products{$ShortName . "3"} . "\n", "<BR>");
  668.         }
  669.         if ($Products{$ShortName . "4"} ne "") {
  670.             &PrintHtml("<DD>", "\tProduct4: " . $Products{$ShortName . "4"} . "\n", "<BR>");
  671.         }
  672.         if ($Products{$ShortName . "5"} ne "") {
  673.             &PrintHtml("<DD>", "\tProduct5: " . $Products{$ShortName . "5"} . "\n", "<BR>");
  674.         }
  675.         $Size = `du -ks $PRODUCTS_DIR/$ShortName`;
  676.         chop $Size;
  677.         $Size =~ s/(\d*).*/\1/;
  678.         &PrintHtml("<DD>", "\tTotal size: $Size Kb\n", "<BR>");
  679.         $TotalSize += $Size;
  680.         if ( $Platform{$ShortName} =~ /demo|testdrive|install/) {
  681.             &PrintHtml("<DD>", "\t", "");
  682.             if ($Platform{$ShortName} =~ /demo/) {
  683.                 &PrintHtml("", "Slide-show, ", "");
  684.             }
  685.             if ($Platform{$ShortName} =~ /testdrive/) {
  686.                 &PrintHtml("", "Demo version, ", "");
  687.             }
  688.             if ($Platform{$ShortName} =~ /install/) {
  689.                 &PrintHtml("", "Unlockable version, ", "");
  690.             }
  691.             &PrintHtml("", "\n", "<BR>");
  692.         }
  693.     }
  694.     &PrintHtml("<BR><BR>", "\n\nTotal size for all companies: $TotalSize Kb\n", "<BR>");
  695.     $Size = `du -ks $PRODUCTS_DIR/$ShortName`;
  696.     chop $Size;
  697.     $Size =~ s/(\d*).*/\1/;
  698.     &PrintHtml("", "Total size for .products: $Size Kb\n", "<BR>");
  699. }
  700.  
  701. ##############################################################################
  702. # CreateApplet:
  703. ##############################################################################
  704. sub CreateApplet
  705. {
  706.     &PrintHtml("", "\nBuilding Control bar applets ...\n", "<BR>");
  707.     $TmpFile = "/tmp/tmpupdateapplet";
  708.     foreach $Comp (sort keys(%Companies)) {
  709.         $FRAMEFILENAME = "$PRODUCTS_DIR/$Comp/$FRAMEBASICNAME";
  710.         if (open (FRAMEFILE, "> $FRAMEFILENAME")) {
  711.             print FRAMEFILE "<html> <head>\n<title>Sun Solutions October 1996: $Companies{$Comp}</title>\n</head>\n<FRAMESET ROWS=\"50,*\">\n<FRAME SCROLLING=\"no\" TARGET=\"_top\" NAME=\"menu\" NORESIZE SRC=\"SunSolutions.head.html\">\n<FRAME SCROLLING=\"yes\" NAME=\"content\" NORESIZE MARGINHEIGHT=4 SRC=\"$HomePageName{$Comp}\">\n</BODY> </NOFRAME> </FRAMESET> </HTML>\n";
  712.             close(FRAMEFILE);
  713.         } else {
  714.             &PrintHtml("", "ERROR: Couldn't write $FRAMEFILENAME\n", "<BR>");
  715.         }
  716.  
  717.         $HEADFILENAME = "$PRODUCTS_DIR/$Comp/$HEADBASICNAME";
  718.         if (open (HEADFILE, "> $HEADFILENAME")) {
  719.             print HEADFILE "<html> <head>\n<title>Sun Solutions October 1996</title>\n</head>\n<BODY BACKGROUND=../SunSolutions/images/back3.gif>\n<CENTER>\n<applet code=ImageMap.class width=596 height=36>\n<param name=highlight value=\"brighter60\">";
  720.             
  721.             $TestGif = 0;
  722.             if ($Platform{$Comp} =~ /demo/) {
  723.                 $TestGif ++;
  724.             }
  725.             if ($Platform{$Comp} =~ /testdrive/) {
  726.                 $TestGif += 2;
  727.             }
  728.             if ($Platform{$Comp} =~ /install/) {
  729.                 $TestGif += 4;
  730.             }
  731.             @BarFileNames = ("none", "rd", "td", "tdrd", "ts", "tsrd", "tdts", "samplebar");
  732.             print HEADFILE "<param name=img value=\"$PRODUCTS_DIR/SunSolutions/images/$BarFileNames[$TestGif].gif\">\n";
  733.  
  734.             print HEADFILE "<param name=area1 value=\"HrefButtonArea,0,0,80,35,http://localhost:7999/cgi-bin/show.bat/?DEST=companies\" >\n";
  735.             print HEADFILE "<param name=area2 value=\"HrefButtonArea,81,0,84,35,http://localhost:7999/SunSolutions/search.html\" >\n";
  736.             print HEADFILE "<param name=area3 value=\"HrefButtonArea,164,0,83,35,http://localhost:7999/SunSolutions/docs/info/Info.html\" >\n";
  737.             print HEADFILE "<param name=area4 value=\"HrefButtonArea,267,0,85,35,http://localhost:7999/cgi-bin/req_more_info.pl?$Comp\" >\n";
  738.  
  739.             $Area = 5;
  740.             if ($Platform{$Comp} =~ /demo/) {
  741.                 print HEADFILE "<param name=area$Area value=\"HrefButtonArea,350,0,83,35,http://localhost:7999/$Comp/_install/install_show.sh\">\n";
  742.                 $Area ++;
  743.             }
  744.             if ($Platform{$Comp} =~ /testdrive/) {
  745.                 print HEADFILE "<param name=area$Area value=\"HrefButtonArea,434,0,81,35,http://localhost:7999/$Comp/_install/run.sh\">\n";
  746.                 $Area ++;
  747.             }
  748.             if ($Platform{$Comp} =~ /install/) {
  749.                 print HEADFILE "<param name=area$Area value=\"HrefButtonArea,515,0,83,35,http://localhost:7999/$Comp/_install/install.sh\">\n";
  750.             }
  751.             
  752.             print HEADFILE "</applet> </CENTER> </BODY> </HTML>\n";
  753.  
  754.  
  755.             close(HEADFILE);
  756.         } else {
  757.             &PrintHtml("", "ERROR: Couldn't write $HEADFILENAME\n", "<BR>");
  758.         }
  759.  
  760.              #$HOMEFILENAME = "../$Comp/" . $HomePageName{$ShortDir};
  761.         #if (open (HOMEFILE, "$HOMEFILENAME")) {
  762.             #open (TMPFILE, "$TmpFile");
  763.             #while (<TMPFILE>) {
  764.                 #$Line = $_;
  765.                 #if ($Line =~ /^<applet class=cdbar/i) {
  766.                     #while (! <HOMEFILE> =~ /^<\/applet>/i) {
  767.                     #}
  768.                     #$TestGif = 0;
  769.                     #if ($Platform{$Comp} =~ /demo/) {
  770.                         #$TestGif ++;
  771.                     #}
  772.                     #if ($Platform{$Comp} =~ /testdrive/) {
  773.                         #$TestGif ++;
  774.                     #}
  775.                     #if ($Platform{$Comp} =~ /install/) {
  776.                         #$TestGif ++;
  777.                     #}
  778.                     #print TMPFILE "<app class=CDbar img=\"http://localhost:7999/SunSolutions/images/none.gif";
  779.                     #print TMPFILE "highlight=brighter60";
  780. ##            print "area1=HrefButtonArea,0,0,80,35,http://localhost:7999/SunSolutions/index.html" >> applet
  781. ##            print "area2=HrefButtonArea,81,0,84,35,http://localhost:7999/.categories/companies.html" >> applet
  782. ##            print "area3=HrefButtonArea,164,0,83,35,http://localhost:7999/SunSolutions/docs/info/Info.html" >> applet
  783. ##            print "area4=HrefButtonArea,267,0,85,35,http://localhost:7999/DEV/disabled.html" >> applet
  784. ##            print ">" >> applet
  785. ##                        breaksw    
  786. ## 
  787.                     #next;
  788.                 #}
  789.                 #print TMPFILE $Line;
  790.             #}
  791.         #}
  792.         #rename($TmpFile, $HOMEFILENAME);
  793.     }
  794.     &PrintHtml("", "\tControl bar applets built...\n", "<BR>");
  795. }
  796. ###############################################################################
  797. ## CreateNames
  798. ###############################################################################
  799. sub CreateNames
  800. {
  801. open (REALNAMES, "> $PRODUCTS_DIR/.bin/real_names.txt");
  802.    write REALNAMES;
  803.     foreach $comp (keys(%Companies)) {
  804.         print REALNAMES "$comp\t$Companies{$comp}\n";
  805.     }
  806. # this is for directories without _info files
  807.    print REALNAMES "SunProducts\tSun Products\n";
  808.    print REALNAMES ".Internet\tInternet Articles\n";
  809. close(REALNAMES);
  810. }
  811.  
  812. ###############################################################################
  813. ## CreateProduct
  814. ###############################################################################
  815. sub CreateProduct
  816. {
  817.     &PrintHtml("<BR>", "\nCreating Products page...\n", "<BR>");
  818.  
  819.          $PRODFILENAME = "$CAT_DIR/products.html";
  820.          $PRODHEADFILENAME = "$CAT_DIR/products.head.html";
  821.     if (open (PRODFILE, "> $PRODFILENAME") && open(PRODHEADFILE, "> $PRODHEADFILENAME")) {
  822.         $old = select(PRODFILE);
  823.  
  824.         $~ = "CATBEGIN";
  825.         write PRODFILE;
  826.         $Letter = "0";
  827.         @Letters = ();
  828.         foreach $Prod (sort FilteredSort keys(%RevProd)) {
  829.             $ShortName = substr($RevProd{$Prod}, 0, length($RevProd{$Prod}) - 1);    
  830.             
  831.             #print STDOUT "        Prod=$Prod, ShortName=$ShortName.\n";
  832.             $ProdAb = $Prod;
  833.             $ProdAb =~ tr/a-z/A-Z/;
  834.             $ProdAb =~ s/^THE //;
  835.             $ProdAb =~ s/^\.//;
  836.             $ProdAb =~ s/^[     ]*//;
  837.             unless ($ProdAb =~ /^$Letter/) {
  838.                 $Letter = substr($ProdAb, 0, 1);
  839.                 print PRODFILE "<DT><A NAME=\"$Letter\"><B>$Letter</B></A>";
  840.                 push (@Letters, $Letter);
  841.             }
  842.  
  843.                 #print PRODFILE "<DD><A HREF=http://localhost:7999/$ShortName/$HomePageName{$ShortName}><B>$Prod</B></A> <I>from</I> <B>$Companies{$ShortName}</B>\n";
  844.                 print PRODFILE "<DD><A HREF=http://localhost:7999/$ShortName/$FRAMEBASICNAME><B>$Prod</B></A> <I>from</I> <B>$Companies{$ShortName}</B>";
  845. #
  846. #     this is for testdrive, install, demo icons
  847. #
  848.                                 if ($Platform{$ShortName} =~ /demo/ ) {
  849.                                 print PRODFILE "<img src=\"http://localhost:7999/SunSolutions/images/demo.gif\">";
  850.                                 }
  851.                                 if ($Platform{$ShortName} =~ /testdrive/ ) {
  852.                                 print PRODFILE "<img src=\"http://localhost:7999/SunSolutions/images/testdrive.gif\">";
  853.                                 }
  854.                                 if ($Platform{$ShortName} =~ /install/ ) {
  855.                                 print PRODFILE "<img src=\"http://localhost:7999/SunSolutions/images/install.gif\">";
  856.                                 }
  857.                                 print PRODFILE "\n";
  858.  
  859.             }
  860.      
  861.         $~ = "CATEND";
  862.         write PRODFILE;
  863.         close (PRODFILE);
  864.  
  865.         select(PRODHEADFILE);
  866.         $~ = "CATHEADERBEGIN";
  867.         write PRODHEADFILE;
  868.                 print PRODHEADFILE "<IMG border=0 SRC=\"$DIR_IMAGES/products.gif\"  alt=\"\" USEMAP=#banner ismap>";
  869.         print PRODHEADFILE "<MAP Name=\"banner\">";
  870.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=companies\" COORDS=7,12,69,40>\n";
  871.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"?DEST=products\" COORDS=3,48,69,80>\n";
  872.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http:\/\/localhost:7999\/SunSolutions\/docs\/info\/Info.html\" COORDS=73,6,142,46>\n";
  873.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http:\/\/localhost:7999\/SunSolutions\/index.html\" COORDS=72,40,143,85>\n";
  874.                 print PRODHEADFILE "<AREA SHAPE=\"RECT\" HREF=\"http://localhost:7999/SunSolutions/index.html\" COORDS=200,0,595,74>\n";
  875.  
  876.         print PRODHEADFILE "</MAP></td><tr><td><center>";
  877.         #$~ = "CATHEADERMIDDLE";
  878.         #write PRODHEADFILE;
  879.  
  880.             #print PRODHEADFILE `cat $Header{$catword}`;
  881.         #unless ($Categories{$catword} eq "") {
  882.                 #print PRODHEADFILE "<H1>$Categories{$catword}</H1>";
  883.         #}
  884.  
  885.         #@Letters = ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
  886.         print PRODHEADFILE "<B><FONT size=\"4\"> Go to:\n";
  887.         foreach $letter (@Letters) {
  888. # below changed by Marc
  889.             #print PRODHEADFILE "<A HREF=\"?DEST=$catword&L=$letter\">$letter</A>\n";
  890.             print PRODHEADFILE "<A HREF=\"?DEST=products&L=$letter\">$letter</A>\n";
  891.         }
  892.         $~ = "CATHEADEREND";
  893.         write PRODHEADFILE;
  894.         close (PRODHEADFILE);
  895.  
  896.         &PrintHtml("<DD>", "\tproducts.html page created.\n", "<BR>");
  897.  
  898.         select($old);
  899.     }
  900. }
  901. ##############################################################################
  902. # MAIN PART: Decode the parameters and calls the correct subfunctions
  903. ##############################################################################
  904. #$arg0=$0
  905. #$DIR=$arg0:h
  906. #$ProgName=$arg0:t
  907.  
  908. #if ("X$DIR" == "X$ProgName") {
  909.     #$DIR='.'
  910. #}
  911.  
  912. #if (-e "./$ProgName") {
  913.     #$DIR=$cwd
  914. #}
  915.  
  916. #cd  $DIR
  917. #print `pwd`;
  918.  
  919. #
  920. # Create the category pages seen in the categories.txt file
  921. #
  922.  
  923. #foreach $en (sort keys %ENV) {
  924.     #print "$en = $ENV{$en}\n";
  925. #}
  926.  
  927.  
  928.     $CATS = "false";
  929.     $APPLETS = "false";
  930.     $COMP = "false";
  931.     $CHECK = "false";
  932.     $REPORT = "false";
  933.     $HTML_FORMAT = "false";
  934.     $PROD = "false";
  935.     $SOFT = "false";
  936.     $PLATFORM = "sparc";
  937.  
  938.     $DIR_IMAGES = "http://localhost:7999/SunSolutions/images/";
  939.     $PRODUCTS_DIR = "../";
  940.  
  941.     # parse command line arguements
  942.  
  943.     #print "Arg=@ARGV.\n";
  944.     @ARGREPORT = @ARGV;
  945.     if (@ARGV == 0) {
  946.         @ARGV=("-?");
  947.     }
  948.  
  949.         while ($ARGV[0] =~ /^-/) {
  950.             $_ = shift;
  951.             #print "Arg=$_.\n";
  952.             if (/^-cats$/) {
  953.                 $CATS = "true";
  954.             } elsif (/^-applets/) {
  955.                 $APPLETS = "true";
  956.             } elsif (/^-comp/) {
  957.                 $COMP = "true";
  958.             } elsif (/^-checkall/) {
  959.                 $CHECK = "true";
  960.                 $CHECKLINKS = "true";
  961.             } elsif (/^-checklinks/) {
  962.                 $CHECKLINKS = "true";
  963.             } elsif (/^-check/) {
  964.                 $CHECK = "true";
  965.             } elsif (/^-soft/) {
  966.                 $SOFT = "true";
  967.             } elsif (/^-report/) {
  968.                 $REPORT = "true";
  969.             } elsif (/^-html/) {
  970.                 $HTML_FORMAT = "true";
  971.                         } elsif (/^-names/) {
  972.                                 $NAMES = "true";
  973.             } elsif (/^-dir/) {
  974.                 $PRODUCTS_DIR = ($1 ? $1 : shift);
  975.                 unless (-s $PRODUCTS_DIR) {
  976.                     die "ERROR: $PRODUCTS_DIR is not a directory\n";
  977.                 }
  978.             } elsif (/^-prod/) {
  979.                 $PROD = "true";
  980.             } elsif (/^-all/) {
  981.                 $PROD = "true" ;
  982.                 $COMP = "true";
  983.                 $SOFT = "true";
  984.                 $APPLETS = "true";
  985.                 $CATS = "true";
  986.                 $NAMES = "true";
  987.             } elsif (/^-x86/) {
  988.                 $PLATFORM = x86;
  989.                 $SRC_DIR = "../../../x86.image";
  990.             } elsif (/^-[?Hh]/) {
  991.                 die "Usage: update.pl [ -cats | -applets | -soft | -prod | -all | -dir dirname | -x86  | -report | -html | -names | -check]\n\tall: = -cats -prod -applets\n\tapplets: creates an applet in the customer home page.\n\tcats: creates the category and company pages.\n\tcheck: check the _info file, and other things for errors.\n\tdir: gives the directory where the companies are located.\n\thtml: when -report is selected, creates an output in HTML format.\n\tnames: create list of company names keyed on directory name.\n\tprod: creates the product page.\n\treport: creates a report for all companies.\n\tsoft: creates the Software pages\n\tx86: for future usage.\n";
  992.             } else {
  993.                 die "Unrecognized switch: $_ (try -?)\n";
  994.             }
  995.         }
  996.  
  997. &PrintHtml("<HTML> <HEAD> <title>Sun Solutions - status on " . `date` . "</title> </HEAD> <BODY BACKGROUND=../SunSolutions/images/back3.gif bgcolor=\"#DDDDDD\"><H1>", "Sun Solutions - status on " . `date` . "\n", "</H1>");
  998.  
  999.  
  1000. # check if root user
  1001. if ( $ENV{"USER"} ne "root" ) {
  1002.         &PrintHtml("", "WARNING: This program should be run as root user.\n", "<BR>");
  1003.     }
  1004.  
  1005.  
  1006.     if ($REPORT ne "true") {
  1007.         $HostName = `hostname`;
  1008.         chop $HostName;
  1009.         &PrintHtml("", "\nUpdating Sun Solutions on $HostName:\n\n", "<BR>");
  1010.     if (open (REPORTFILE, ">> $PRODUCTS_DIR/.update.txt")) {
  1011.         $Date = `date`;
  1012.         chop $Date;
  1013.         print REPORTFILE "update by " . $ENV{"USER"} . " on $Date from $HostName\n\tparams: ";
  1014.         while (@ARGREPORT) {
  1015.             print REPORTFILE "$ARGREPORT[0], ";
  1016.             shift @ARGREPORT;
  1017.         }
  1018.         print REPORTFILE "\n\n";
  1019.         close (REPORTFILE);
  1020.     } else {
  1021.         &PrintHtml("", "WARNING: Cannot open $PRODUCTS_DIR/.update.txt\n", "<BR>");
  1022.     }
  1023. }
  1024.  
  1025. &InitCompInfo();
  1026.  
  1027. $CAT_DIR = "$PRODUCTS_DIR/.categories";
  1028. $FRAMEBASICNAME = "SunSolutions.frame.html";
  1029. $HEADBASICNAME = "SunSolutions.head.html";
  1030. #print $CAT_DIR;
  1031. if ( ! -d $CAT_DIR ) {
  1032.     mkdir($CAT_DIR, 0777);
  1033. }
  1034.  
  1035. if ( $CHECK eq "true" ) {
  1036.     &CheckFiles();
  1037. }
  1038. if ( $NAMES eq "true" ) {
  1039.         &CreateNames();  
  1040. }
  1041.  
  1042.  
  1043. if ( $CHECKLINKS eq "true" ) {
  1044.     &CheckLinks();
  1045. }
  1046.  
  1047. if ( $CATS eq "true" ) {
  1048.     &CreateCat();
  1049. }
  1050.  
  1051. if ( $SOFT eq "true" ) {
  1052.     &CreateSoft();
  1053. }
  1054.  
  1055. #
  1056. # Get all SunSolutions menu bar components and put in file 
  1057. # for building of front page applet 
  1058. #
  1059. if ( $APPLETS eq "true" ) {
  1060.     &CreateApplet();
  1061. }
  1062.  
  1063. if ( $PROD eq "true" ) {
  1064.     &CreateProduct();
  1065. }
  1066.  
  1067. if ( $REPORT eq "true" ) {
  1068.     &CreateReport();
  1069. }
  1070.  
  1071. #
  1072. # Compile list of companies, place in 'companies' file
  1073. #
  1074. #if ( $COMP eq "true" ) {
  1075.     #&CreateComp();
  1076. #}
  1077.  
  1078. #
  1079. # Compile list of products, place in 'products' file
  1080. #
  1081.  
  1082. #print "\n\n\nPress <RETURN> to close the window and test your submission..\n.";
  1083. #read answer;
  1084.  
  1085. ################################################################################
  1086. # Define FORMATS (no more code)
  1087. ################################################################################
  1088. format CATHEADERBEGIN =
  1089. <html>
  1090. <body  BGCOLOR="#8c8cde" link=#33ff00 vlink=#33ff00 >
  1091. <BASE TARGET="_top" HREF="http://localhost:7999/cgi-bin/show.bat/">
  1092. <center>
  1093. <form method="get"  ACTION="http://localhost:7999/cgi-bin/brandnewwais.pl/wais_SunSolutions">
  1094. <table border = 3><td>
  1095. <MAP Name="banner">
  1096. .
  1097.  
  1098. format CATHEADERMIDDLE =
  1099. </MAP></td><tr><td><center>
  1100. <B><FONT size="4">
  1101. #<B>Go to:  </b>
  1102. .
  1103.  
  1104. format CATHEADEREND =
  1105. #<br> Search: <input type="text" name="isindex" size="12" >
  1106. </font>
  1107. </td><tr></table>
  1108. </form>
  1109. </center>
  1110. </body>
  1111. </html>
  1112. .
  1113.  
  1114. format CATBEGIN =
  1115. <HTML>
  1116.         <!-- header section-->
  1117. <HEAD>
  1118. <title>Sun Solutions - October</title>
  1119. </HEAD>
  1120.         <!-- document body-->
  1121. <BODY  BACKGROUND=../SunSolutions/images/back3.gif bgcolor="#DDDDDD">
  1122. <BASE TARGET="_top">
  1123. <DL>
  1124. #<hr>
  1125. #<p>
  1126. .
  1127.  
  1128. format CATEND =
  1129. </B></B><DT>
  1130. <hr>
  1131. </BODY>
  1132. </HTML>
  1133. .
  1134.  
  1135. format SOFTWAREHEAD =
  1136. <HTML>
  1137.         <!-- header section-->
  1138. <HEAD>
  1139. <TITLE>Sun Solutions - Software Categories</TITLE>
  1140. </HEAD>
  1141.         <!-- document body-->
  1142. <BODY BGCOLOR="8c8cde" link=#33ff00 vlink=#33ff00>
  1143. <CENTER>
  1144. <BASE TARGET="_top" HREF="http://localhost:7999/cgi-bin/show.bat/">
  1145. <form method="get"  ACTION="http://localhost:7999/cgi-bin/brandnewwais.pl/wais_SunSolutions">
  1146. <table border = 3><td>
  1147. <IMG border=0 SRC="http://localhost:7999/SunSolutions/images/software.gif" alt="" USEMAP=#banner ismap>
  1148. <MAP Name="banner">
  1149. <AREA SHAPE="RECT" HREF="?DEST=companies" COORDS=7,12,69,40>
  1150. <AREA SHAPE="RECT" HREF="?DEST=products" COORDS=3,48,69,80>
  1151. <AREA SHAPE="RECT" HREF="http://localhost:7999/SunSolutions/docs/info/Info.html" COORDS=73,6,142,46>
  1152. <AREA SHAPE="RECT" HREF="http://localhost:7999/SunSolutions/index.html" COORDS=72,40,143,85>
  1153. <AREA SHAPE="RECT" HREF="http://localhost:7999/SunSolutions/index.html" COORDS=200,0,595,74>
  1154. </MAP>
  1155. </TD><TR><TD>
  1156. <CENTER>
  1157. <FONT size="4">
  1158. #<br>Search: <input type="text" name="isindex" size="12" >
  1159. </font>
  1160. </CENTER>
  1161. </td><tr></table>
  1162. </CENTER>
  1163. </form>
  1164. </BODY>
  1165. </HTML>
  1166. .
  1167. ##############################################################################
  1168. format FRAMEHEADER =
  1169. Content-type: text/html
  1170.  
  1171.  
  1172.  
  1173. <html>
  1174. <head>
  1175. <title>Sun Solutions October 1996</title>
  1176. </head>
  1177. <FRAMESET ROWS="20,80">
  1178. #$size
  1179. .
  1180. ##############################################################################
  1181. format FRAMEFOOTER =
  1182. <BODY BACKGROUND="icons/bkgrnds/homebg.gif" body  BACKGROUND=../SunSolutions/images/back3.gif bgcolor=black text=#ffffff link=#dddddd alink=#ffff00 vlink=#bbbbbb>
  1183.  
  1184. <FONT SIZE=-1>Copyright \0511995 <B><A
  1185.  
  1186. </BODY>
  1187. </NOFRAME>
  1188. </FRAMESET>
  1189. </HTML>
  1190. .
  1191.